function RefeshDM()
{	
	$('#DMThoi').attr("disabled", false);

	var e = document.getElementById("DM");
	var ma = e.options[e.selectedIndex].value;

	document.getElementById('danhmucTK').style.display = 'none';
	document.getElementById('danhmucDV').style.display = 'none';
	document.getElementById('danhmucVT').style.display = 'none';
	document.getElementById('danhmucKHO').style.display = 'none';
	document.getElementById('danhmucNT').style.display = 'none';



	if (ma == 0)
	{
		document.getElementById('danhmucDV').style.display = 'block';
	}
	else if (ma == 1)
	{
		document.getElementById('danhmucTK').style.display = 'block';
	}
	else if (ma == 3)
	{
		document.getElementById('danhmucVT').style.display = 'block';
	}
	else if (ma == 4)
	{
		document.getElementById('danhmucKHO').style.display = 'block';
	}
	else if (ma == 2)
	{
		document.getElementById('danhmucNT').style.display = 'block';
	}


}

function HideDM()
{	$('#DMThoi').attr("disabled", true);
	var e = document.getElementById("DM");
	document.getElementById('danhmucTK').style.display = 'none';
	document.getElementById('danhmucDV').style.display = 'none';

}

function refreshDMDV(letter, url)
{
	url = url+ "?dmdv_initial="+ letter;
	jQuery.ajax({
       type: "POST",
       url: url,
       cache: false,
       success: function(response)
       {
		   //alert(response);
		   document.getElementById('danhmucDV_ND').innerHTML = "Các Đơn vị bắt đầu là <b>" + letter+ "</b>:(Nhấn CRL+F để tìm kiếm)<hr>"+ response;
		   
       },
	
	   error: function(data, errorThrown)
	  {
		  alert('request failed :'+errorThrown);
	  }
     });


}
